package com.yeeverse.api.demo.test.h5;

import com.alibaba.fastjson.JSON;
import com.yeeverse.api.demo.test.BaseTest;
import com.yeeverse.sdk.api.PaycenterApi;
import com.yeeverse.sdk.util.JsonUtils;
import org.junit.Test;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class UnionH5  extends BaseTest {


    @Test
    //批量空投+跳转页面
    public void test1() throws Exception {
        Map<String, Object> map = new HashMap<>();
        map.put("parentMerchantNo", "3203001000361089082");
        map.put("requestNo", "gy" + System.currentTimeMillis());
        map.put("merchantUserId", "yangkai");
        map.put("redirectType", "SHOP");

        List<Map> airdropDetailList=new ArrayList<>();
        Map<String,String> aMap=new HashMap<>();
        aMap.put("merchantOrderId","testOrder"+System.currentTimeMillis());
        aMap.put("goodId","414");

        airdropDetailList.add(aMap);

        map.put("airdropDetailList", airdropDetailList);


        System.out.println("请求参数="+ JsonUtils.toJsonString(map));
        Map mapRspDataVO = new PaycenterApi().baseRequest(map, "/v2/rest/authCode2Url", Map.class);
        System.out.println("解密response报文：" + JSON.toJSONString(mapRspDataVO));
    }

    @Test
    //批量空投+跳转页面
    public void test5() throws Exception {
        Map<String, Object> map = new HashMap<>();
        map.put("parentMerchantNo", "3203001000361089082");
        map.put("sourceRequestNo", "gy1668504160828");

        System.out.println("请求参数="+ JsonUtils.toJsonString(map));

        Map mapRspDataVO = new PaycenterApi().baseRequest(map, "/v2/rest/queryBatchSendAirdrop", Map.class);
        System.out.println("解密response报文：" + JSON.toJSONString(mapRspDataVO));
    }
}
